#include<stdio.h>
#include<errno.h>
#include<stdlib.h>
#include<string.h>

int main(){
    FILE *f;
    int count =0;
    while (1)
    {
        f = fopen("tmp","r");
        if (f == NULL)
        {
            perror("fopen()");
            break;
        }
        count ++;
    }

    printf("%d",count);
    exit(0);
}